package 补充.输入输出操作.字节流;

import java.io.*;

public class 文件的复制 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("D:\\Learn\\javademo\\untitled\\src\\补充_偏\\输入输出操作\\文件\\test.jpg");
        FileOutputStream fos= new FileOutputStream("D:\\Learn\\javademo\\untitled\\tar\\test.jpg");
        int len ;
        long begin = System.currentTimeMillis();
        while ((len=fis.read())!=-1){
            fos.write(len);
        }
        long end = System.currentTimeMillis();
        System.out.println("复制文件耗时"+(end - begin));
        fis.close();
        fos.close();
    }
}
